<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp"%>
<script type="text/javascript">

	$(function() {
		
		$('#familyAddAreaId').combotree({
			url : '${path }/areaInfo/tree',
			parentField : 'pid',
			panelHeight : 'auto',
			value : '${areaInfo.areaId}'
		});
		
		
		$('#familyEditForm').form({
			
			url : '${path }/family/edit',
			onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
			success : function(result) {
				 progressClose();
	                result = $.parseJSON(result);
	                if (result.success) {
	                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
	                    parent.$.modalDialog.handler.dialog('close');
	                } else {
	                    var form = $('#familyEditForm');
	                    parent.$.messager.alert('错误', eval(result.msg), 'error');
	                }
				
			}
		});

	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="familyEditForm" method="post">
		<table class="grid">
			<tr>


				<td>家庭编号</td>
				<input name="id" type="hidden" value="${family.id}">
				<td><input name="familyNo" type="text"
					value="${family.familyNo}" placeholder="请输入家庭编号"
					class="easyui-validatebox" data-options="required:true"></td>
			</tr>
			<tr>
				<td>户主名称</td>
				<td><input name="housemaster" type="text"
					value="${family.housemaster}" placeholder="请输入户主名称"
					class="easyui-validatebox" data-options="required:true"></td>
			</tr>
			<tr>
				<td>身份证号</td>
				<td><input name="housemaster" type="text"
					value="${family.cardNo}" placeholder="请输入身份证号"
					class="easyui-validatebox" data-options="required:true"></td>
			</tr>
			<tr>
				<td>地区id</td>
				<td><select id="familyAddAreaId" name="areaNo"
					style="width: 140px; height: 29px;" class="easyui-validatebox"
					data-options="required:true"></select></td>
			</tr>
		</table>
	</form>
	</div>
</div>
